package com.zy.xuanwo.zyc.portal.parser.imp;


import com.zy.xuanwo.zyc.portal.bean.WxApp;
import com.zy.xuanwo.zyc.portal.parser.BaseParser;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * remarks:
 * Created by ChowYvlChen on 2016/7/6  14:54
 */
public class WxAppParser extends BaseParser<WxApp> {
    @Override
    public WxApp parserJSON(String jsonStr) throws JSONException {
        WxApp mWxApp = null;
        if (super.ParseResultPoly(jsonStr) == null) {
            mWxApp = new WxApp();
            JSONObject mJSONObject = new JSONObject(jsonStr);
            if (mJSONObject.has("result")) {
                mWxApp.setResult(mJSONObject.getString("result"));
            }
            if (mJSONObject.has("id")) {
                mWxApp.setId(mJSONObject.getString("id"));
            }
        }
        return mWxApp;
    }
}
